package com.gxa.pingan.common;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
 * 这是一个给fastJSON/jackson准备的一个对象
 * @author YXQ
 * @date 2021/9/13 16:50
 */
public class JsonResult implements Serializable {
    private Map<String,Object> dataMap = new HashMap<>(3);

    public JsonResult() {
    }

    public String getCode() {
        return dataMap.get("code").toString();
    }

    public void setCode(String code) {
        this.dataMap.put("code",code);
    }

    public String getMsg() {
        return dataMap.get("msg").toString();
    }

    public void setMsg(String msg) {
        this.dataMap.put("msg",msg);
    }

    public Object getData() {
        return dataMap.get("data");
    }

    public void setData(Object data) {
        // this.data = data;
        this.dataMap.put("data",data);
    }

    public Map<String, Object> getDataMap() {
        return dataMap;
    }

    public void setDataMap(Map<String, Object> dataMap) {
        this.dataMap = dataMap;
    }

    public void put(String name, Object value){
        this.dataMap.put(name,value);
    }
}
